<?php



include '/simplehtmldom/simple_html_dom.php';
set_time_limit(0);

header('connection', 'Keep-Alive');
header('accept-language', 'en-us');
header('accept-encoding', 'gzip, deflate');
header('user-agent', 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322)'); 

$link = mysql_connect('localhost', 'root', '');
if (!$link) {
    die('connected to DB not successfully !!!' . mysql_error());
}
echo 'connected to DB successfully <br>';

$db_selected = mysql_select_db('bcc', $link);
if (!$db_selected) {
    die ('No DB available : ' . mysql_error());
}



$result = mysql_query("Select link_to, comm_id from links");
		

while($row = mysql_fetch_array($result)){
	$e = explode("?", $row[0]);
	$r = mysql_query("UPDATE links SET link_to='http://www.billycurrington.com/member/friends.aspx?" . $e[1] . "' WHERE comm_id=" . $row[1]);
	echo "UPDATE links SET link_to='http://www.billycurrington.com/member/friends.aspx?" . $e[1] . "' WHERE comm_id=" . $row[1] . "\n";
}


 mysql_close($link);	  
	   //$html->getElementById("imgHolder")->childNodes(1)->childNodes(1)->getAttribute('href');

?>